<?

// 입력모드에 따라 처리모듈 분기
/*

?q=

node/NUMBER#NUMBER2				: node[NUMBER]#comment[NUMBER2] view
node/write										: node write form
node/add											: node insert query
node/delete/NUMBER						: node[NUMBER] delete query
node/edit/NUMBER							: node[NUMBER] edit form
node/update/NUMBER						: node[NUMBER] update query
node/vote/NUMBER

list/NUMBER									: list page[NUMBER]

search												: search form
search/WORD+-WORD						: search result [WORD] ; +(or), -(exclusive), &(and)

page/NUMBER									: node[page][NUMBER] list view
clip/NUMBER
post/NUMBER
link/NUMBR
file/NUMBER									: file[NUMBER] download
archive/DATE[Y/m/s]

categories/NUMBER							: list by category[NUMBER]
categories/page/NUMBER					: list by category page[NUMBER]
categories/search/WORD
region/NUMBER								: list by region[NUMBER]
region/page/NUMBER						: list by region page[NUMBER]
region/search/WORD
tag/WORD										: list by tag[WORD]
tag/page/WORD								: list by tag page[WORD]

campaign/TITLE
campaign/TITLE/[page][wiki][post][news][poll][...]
campaign/TITLE/search/WORD

member/list/[NUMBER]					: member list page[NUMBER}
member/NUMBER								: member infomation view
member/subscribe								: member subscribe form
member/add										: member subscribe(insert) query
member/withdraw								: member withdraw form
member/withdrawal/NUMBER			: member[NUMBER] withdraw query
member/edit/NUMBER						: member[NUMBER] edit form
member/update/NUMBER					: member[NUMBER] update query

login
login/check
logout

go/NUMBER										: go url[NUMBER]
go/URL												: go URL

trackback/NUMBER							: trackback[node][NUMBER] query

admin/

admin/node/page/NUMBER
admin/node/delete
admin/node/subscribe
admin/node/comment/delete
admin/node/comment/subscribe

admin/categories
admin/categories/add
admin/categories/delete/NUMBER
admin/categories/edit/NUMBER
admin/categories/update/NUMBER

admin/region
admin/region/add
admin/region/delete/NUMBER
admin/region/edit/NUMBER
admin/region/update/NUMBER

admin/campaign
admin/campaign/add
admin/campaign/delete/NUMBER
admin/campaign/close/NUMBER
admin/campaign/edit/NUMBER
admin/campaign/update/NUMBER

admin/setting
admin/setting/update
admin/setting/node
admin/setting/node/update
admin/setting/theme
admin/setting/theme/update

admin/mailing
admin/mailing/NUMBER
admin/mailing/add
admin/mailing/send/NUMBER
admin/mailing/delete/NUMBER
admin/mailing/edit/NUMBER
admin/mailing/update/NUMBER

admin/member
admin/member/add
admin/member/subscribe/NUMBER
admin/member/delete/NUMBER
admin/member/edit/NUMBER
admin/member/update/NUMBER
admin/member/form
admin/member/form/update
admin/member/group
admin/member/group/add
admin/member/group/delete/NUMBER
admin/member/group/edit/NUMBER
admin/member/group/update/NUMBER

admin/log
admin/log/node/NUMBER
admin/log/referer/NUMBER
admin/log/keyword/NUMBER
admin/log/keyword/page/NUMBER
admin/log/rank/
admin/log/rank/node
admin/log/rank/member
admin/log/rank/link
admin/log/rank/file
admin/log/error/NUMBER



*/

// --------------------------------------------
// 초기 변수
// --------------------------------------------
define(_P2_, TRUE); 
define(DIR_APP , "./p2");

// --------------------------------------------
// 초기 구동 파일 삽입
// --------------------------------------------
include DIR_APP . "/cfg.var.php";
include DIR_INCLUDES . "/globals.php";
include DIR_APP . "/cfg.db.php";
//---------------------------------------------------
// 로그인 체크
//---------------------------------------------------
include(DIR_INCLUDES . "/func.login.php");

// --------------------------------------------
// 입력모드에 따라 액션 분기
// $p2[]
// --------------------------------------------
if (!$q) $q = "index";
// --------------------------------------------
// $q가 있을 경우 해킹방지를 위한 체크 추가
// --------------------------------------------
$p2 = explode("/", $q);
include DIR_APP . "/" . $p2[0] . ".php";

// --------------------------------------------
// 출력모드에 따라 출력
// --------------------------------------------
if ($or_print == "1") {
	// 템플릿 출력
}

// --------------------------------------------
// 에러여부에 따라 에러내용 출력
// --------------------------------------------
if($p2var[system][debug] == 1 && $err){
	echo("* BAD^^<br />$err");
}

?>